package com.example.bbbb.funIn;

import java.util.function.Function;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-12-15
 * Time: 13:50
 */
public class Func {
    public static void main(String[] args) {
        // 函数型接口,<接受类型，返回类型>
//        Function<Person, String> function = new Function<Person, String>() {
//            @Override
//            public String apply(Person person) {
//                return person.toString();
//            }
//        };

        Function<Person, String> function = (person) -> {
            return person.name;
        };

        System.out.println(function.apply(new Person()));
    }
}
